package com.zuipin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.zuipin.entity.product.PropertiesVal;

/**
 * @date 2017-8-14 13:02:26
 * @author zhuangjiajian
 * 属性值
 */
@Mapper
public interface PropertiesValMapper {
	
	/**
	 * 有选择字段的插入一条记录
	 * @param record
	 * @return
	 */
	int insertSelective(@Param(value = "record") PropertiesVal record);
	
	/**
	 * 更新
	 * @param record
	 * @return
	 */
	int updateByPrimaryKeySelective(@Param(value = "record") PropertiesVal record);
	
	/**
	 * 批量添加属性值
	 * @param item
	 * @return
	 */
	int insertBatch(List<PropertiesVal> propVals);
	
	/**
	 * @author zhuangjiajian
	 * @date 2017-8-15 17:33:17
	 * 根据属性ID或者属性值模糊查询
	 * @param search
	 * @return
	 */
	List<PropertiesVal> selectPropValByIDOrValName(@Param(value = "search") String search, @Param(value = "propId") Long propId);
	
	/**
	 * @author zhuangjiajian
	 * @date 2017-8-15 17:33:17
	 * 根据属性值ID查询
	 * @param search
	 * @return
	 */
	PropertiesVal selectByPrimaryKey(@Param(value = "id") Long id);
	
	/**
	 * 
	 * @param propId
	 * @return
	 */
	List<PropertiesVal> selectByPropId(@Param(value = "propId") Long propId);
}
